<?php

namespace App\Tools;


class State
{

    private  static $instance = [];

    public static function __callStatic($method,$param)
    {
        $className = get_called_class();
        $key = md5($className);
        if(empty(self::$instance[$key])){
            self::$instance[$key] = new $className();
        }
//        dd(self::$instance[$key]);
        return self::$instance[$key]->$method(... $param);

    }
}
